package BoostedTest::RDBO::Run;

use strict;

use base qw(BoostedTest::RDBO::DB::Object);

__PACKAGE__->meta->setup(
    table   => 'runs',

    columns => [
        id                  => { type => 'serial', not_null => 1 },
        lead_id             => { type => 'integer', default => '0', not_null => 1 },
        owner_id            => { type => 'integer', default => '0', not_null => 1 },
        editions_id         => { type => 'integer', default => '0', not_null => 1 },
        testplan_id         => { type => 'integer', default => '0', not_null => 1 },
        operating_system_id => { type => 'integer', default => '0', not_null => 1 },
        language_id         => { type => 'integer', default => '0', not_null => 1 },
        content             => { type => 'text', length => 65535 },
        verdict             => { type => 'varchar', length => 255 },
        created             => { type => 'datetime' },
        modified            => { type => 'datetime' },
    ],

    foreign_keys =>
    [
      lead_user =>
      {
        class       => 'BoostedTest::RDBO::User',
        key_columns => { lead_id => 'id' },
      },
      
      owner_user =>
      {
        class       => 'BoostedTest::RDBO::User',
        key_columns => { owner_id => 'id' },
      },

      edition =>
      {
        class       => 'BoostedTest::RDBO::Edition',
        key_columns => { editions_id => 'id' },
      },

      testplan =>
      {
        class       => 'BoostedTest::RDBO::Testplan',
        key_columns => { testplan_id => 'id' },
      },

      operating_system =>
      {
        class       => 'BoostedTest::RDBO::OperatingSystem',
        key_columns => { operating_system_id => 'id' },
      },

      language =>
      {
        class       => 'BoostedTest::RDBO::Language',
        key_columns => { language_id => 'id' },
      },

    ],

    primary_key_columns => [ 'id' ],
);

1;

